home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9670 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: news.primenet.com!wisniew
  2. From: Joseph Wisniewski <wisniew@primenet.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Leap Years
  5. Date: 12 Mar 1996 11:07:01 -0700
  6. Organization: Primenet (602)395-1010
  7. Sender: root@primenet.com
  8. Message-ID: <4i4eg5$3v3@nnrp1.news.primenet.com>
  9. References: <8BA8405.02C70020E1.uuout@sourcebbs.com> <4h6ara$mu@netnews1.apci.com> <825684095snz@genesis.demon.co.uk> <4i0sd4$7lr@peachy.apana.org.au> <826593980snz@genesis.demon.co.uk>
  10. X-Posted-By: wisniew@usr2.primenet.com
  11.  
  12. Lawrence Kirby <fred@genesis.demon.co.uk> wrote:
  13. : In article <4i0sd4$7lr@peachy.apana.org.au>
  14. :            grahamb@peachy.apana.org.au "Graham Broadbridge" writes:
  15.  
  16. : >Lawrence Kirby (fred@genesis.demon.co.uk) wrote:
  17. : >: In article <4h6ara$mu@netnews1.apci.com> wardmw@apci.com "Martin Ward"
  18. : > writes:
  19. : >
  20. : >: >david.mohorn@sourcebbs.com (DAVID MOHORN) typed:
  21. : >: >
  22. : >: >>How do you feature out leap years?  If its evenly divisible by 400 and
  23. : >: >>4?
  24.  
  25. : Please take a little more care in trimming down your attributions.
  26.  
  27. : >I can't believe that anyone here can get confused about this.
  28. : >
  29. : >isleap(int year)
  30. : >{
  31. : >if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
  32. : >        printf("%d is a leap year", year);
  33. : >else
  34. : >        printf("%d is not a leap year", year);
  35. : >}
  36.  
  37. : Read the FAQ. The version it contains is slightly more efficient than this
  38. : one.
  39.  
  40.  
  41.   Obviously too confusing for the  software company that runs the 
  42. Arizona lottery though.  You guessed it, February 29th was an invalid
  43. date and no sales or drawing on that date
  44.  
  45. ..: -- 
  46. : -----------------------------------------
  47. : Lawrence Kirby | fred@genesis.demon.co.uk
  48. : Wilts, England | 70734.126@compuserve.com
  49. : -----------------------------------------
  50.  
  51. --
  52. Joe Wisniewski    
  53.   Commercial Software Solutions, Ltd. -- Embedded/RT SW Consulting
  54.   Co-Author: Program Smarter, Not Harder - Get Mission Critical Projects
  55.     Right the First Time ISBN 0-07-021232-5
  56.  
  57.   wisniew@primenet.com   --- The "Baltimore Browns"?     Pazhaloosta!
  58.   Ada95 --> She'll take you to places you never thought possible!
  59.   
  60.